package cn.felord.datetime.convert.controller;

import cn.felord.datetime.convert.bean.TbItem;
import cn.felord.datetime.convert.cache.RedissonLock;
import cn.felord.datetime.convert.cache.RedissonLockModel;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @RedissonLock(keys = "#tbItem.name")
    @PostMapping(value = "num/annotation")
    public String testNumAnnotation(TbItem tbItem) {
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "ok";
    }
}
